home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
PASSRC.ZIP
/
READDATA.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-02-04
|
856b
|
34 lines
(* Chapter 11 - Program 5 *)
program Read_Real_Data_From_A_File;
var Hot_Dog : text;
Index : byte;
Line_Number : integer;
Real1,Real2,Real3 : real;
begin (* main program *)
Assign(Hot_Dog,'REALDATA.TXT');
Reset(Hot_Dog);
for Index := 1 to 7 do begin
Readln(Hot_Dog,Line_Number,Real1,Real2,Real3);
Writeln(Line_Number:7,Real1:12:3,Real2:12:3,Real3:12:3);
end;
Close(Hot_Dog);
end. (* of main program *)
{ Result of execution
1 23.600 145.450 234.800
2 -0.400 -0.050 0.345
3 4.000 3456.000 123.000
4 77.000 5.000 -0.003
6 1.000 2.000 3.000
7 12.120 13.110 14.140
8 2.000 3.000 4.000
}